#ifndef TVLAYOUT_H
#define TVLAYOUT_H
#include <QPoint>
#include <QList>
#include <QSize>
#include <QRect>

class Led;
class TestTvLayout;

class TvLayout
{
	friend class TestTvLayout;

private:
	int LedWidth;
	int LedHeight;
	QPoint startLed;
	QList<int> disabled;
	bool CW;
	QSize ScreenResolution;
	int margins;

	bool isDisabled(int index);
	QPoint countPos(int index);
	QPoint countPos(int x, int y);
	QPoint indexToCoord(int index);

public:
	TvLayout();
	bool generateLeds(QList<Led*> *list);
	bool generateLedsTest(QList<Led*> *list);
	QList<int>* getDisabled() {return &disabled; }
	void enableLed(QPoint point,bool estate);
	QRect countRect(int index);
	int pointToIndex(QPoint point);
	void setStart(int index);
	void setSide(bool cw);
};

#endif // TVLAYOUT_H
